(()=>{"use strict";window.tutor_get_nonce_data||(window.tutor_get_nonce_data=function(t){var e=window._tutorobject||{},r=e.nonce_key||"",e=e[r]||"";return t?{key:r,value:e}:{[r]:e}});const s=function(t=[]){const n=new FormData;return t.forEach(t=>{for(var[e,r]of Object.entries(t))n.set(e,r)}),n.set(window.tutor_get_nonce_data(!0).key,window.tutor_get_nonce_data(!0).value),n};function E(t){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(){j=function(){return a};var a={},t=Object.prototype,u=t.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o,i,a,c,e=e&&e.prototype instanceof h?e:h,e=Object.create(e.prototype),n=new L(n||[]);return s(e,"_invoke",{value:(o=t,i=r,a=n,c="suspendedStart",function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return x()}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.iterator[n];if(void 0===o)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=void 0,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;n=l(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,f;o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,f):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}(r,a);if(r){if(r===f)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===c)throw c="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c="executing";r=l(o,i,a);if("normal"===r.type){if(c=a.done?"completed":"suspendedYield",r.arg===f)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c="completed",a.method="throw",a.arg=r.arg)}})}),e}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var f={};function h(){}function d(){}function p(){}var e={},y=(i(e,n,function(){return this}),Object.getPrototypeOf),y=y&&y(y(_([]))),v=(y&&y!==t&&u.call(y,n)&&(e=y),p.prototype=h.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function m(a,c){var e;s(this,"_invoke",{value:function(r,n){function t(){return new c(function(t,e){!function e(t,r,n,o){var i,t=l(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==E(r)&&u.call(r,"__await")?c.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):c.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function _(e){if(e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r'),"success"==r?"success":"error"==r?"danger":"warning"==r?"warning":"primary"),r="success"==r?"tutor-icon-mark":"error"==r?"tutor-icon-times":"tutor-icon-circle-info-o",i=null!=e&&""!==e.trim(),a=jQuery('\n
\n
\n \n
\n
\n
').concat(t,'
\n

').concat(e,'

\n
\n \n
\n '));a.find(".tutor-noti-close").click(function(){a.remove()}),jQuery(".tutor-toast-parent").append(a),n&&setTimeout(function(){a&&a.fadeOut("fast",function(){jQuery(this).remove()})},5e3)}),document.addEventListener("DOMContentLoaded",function(){"settings"===(window._tutorobject?_tutorobject:"").current_page&&document.querySelectorAll(".tutor-device-sign-out").forEach(function(t){t.onclick=function(){var e=r(O().mark(function t(e){var r,n,o,i;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.target,n=e.target.dataset.umetaId,n=s([{umeta_id:n,action:"tutor_remove_device_manually"}]),t.prev=3,r.classList.add("is-loading"),r.setAttribute("disabled",!0),t.next=8,l(n);case 8:return n=t.sent,t.next=11,n.json();case 11:i=t.sent,o=i.success,i=i.data,o?(tutor_toast(h("Success","tutor-pro"),i.msg,"success"),i.redirect_to?window.location.href=i.redirect_to:r.closest(".tutor-col-md-6").remove()):tutor_toast(h("Failed","tutor-pro"),i.msg,"error"),t.next=19;break;case 16:t.prev=16,t.t0=t.catch(3),tutor_toast(h("Something went wrong","tutor-pro"),h("Please try again after reloading page!"),"error");case 19:return t.prev=19,r.classList.remove("is-loading"),r.removeAttribute("disabled"),t.finish(19);case 23:case"end":return t.stop()}},t,null,[[3,16,19,23]])}));return function(t){return e.apply(this,arguments)}}()});var u=document.querySelector(".tutor-login-form-wrapper, .tutor-login-modal, #login_error, .woocommerce-error");u&&(u.onclick=function(){var e=r(O().mark(function t(e){var r,n,o,i,a,c;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.target,(r=i).hasAttribute("id")&&"tutor-remove-active-logins"===i.getAttribute("id"))return e.preventDefault(),n=document.getElementById("tutor-remove-logins-wrapper"),o=(o=(o=n.closest(".tutor-alert"))||document.getElementById("login_error"))||document.querySelector("ul.woocommerce-error"),i=s([{action:"tutor_remove_all_active_logins"}]),t.prev=9,n.innerHTML=''.concat(h("Please wait...","tutor-pro"),""),t.next=13,l(i);t.next=38;break;case 13:return i=t.sent,t.next=16,i.json();case 16:a=t.sent,c=a.success,a=a.data,c?(o.classList.contains("tutor-warning")&&(o.classList.remove("tutor-warning"),o.classList.add("tutor-success")),o.hasAttribute("id")&&(o.style.borderLeftColor="#6eea98"),o.classList.contains("woocommerce-error")&&o.classList.add("woocommerce-message"),o.innerHTML=h("All of your active login sessions have been removed. You can login now."),t.next=32):t.next=25;break;case 25:if(Array.isArray(a))if((c=a[0])&&"tutor_login_limit"===c.code)return u.insertAdjacentHTML("afterbegin",c.message),t.abrupt("return");t.next=30;break;case 30:tutor_toast(h("Failed","tutor-pro"),a,"error"),n.innerHTML=r;case 32:t.next=38;break;case 34:t.prev=34,t.t0=t.catch(9),console.log(t.t0),tutor_toast(h("Something went wrong","tutor-pro"),h("Please try again after reloading page!"),"error");case 38:case"end":return t.stop()}},t,null,[[9,34]])}));return function(t){return e.apply(this,arguments)}}())}),!1);window.addEventListener("DOMContentLoaded",function(){var e,t,r,n;document.querySelector(".tutor-course-details-page")&&(e=document.querySelector(".tutor-single-course-sidebar")).hasAttribute("data-tutor-sticky-sidebar")&&(t=document.getElementsByTagName("header")[0],r="".concat(t.offsetHeight,"px"),n=t.classList.value.includes("sticky"),window.addEventListener("scroll",function(){var t=window.scrollY;1200<=window.innerWidth&&(200<=t?o||(e.classList.add("tutor-sidebar-sticky"),t="max-height: 80vh; overflow-y: scroll; top: ".concat(n?r:""),e.setAttribute("style",t),e.scrollTop=0,o=!0):(e.classList.remove("tutor-sidebar-sticky"),e.removeAttribute("style"),o=!1))}))})})();